import axios from './index'

const preUrl = ''


// 获取用户列表
const getUserList = {
  p: [`get,/proxy/*/proxy`],
  r: params => {
    return axios.get(`${preUrl}/proxy/${Cookie.get('areaCode')}/proxy`, {
      params
    })
  }
}

// 搜索用户列表
const searchUserList = {
  p: [`get,/game/count/*`],
  r: params => {
    return axios.get(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 新增用户
const addUser = {
  p: [`get,/game/count/*`],
  r: params => {
    return axios.get(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 编辑用户
const editUser = {
  p: [`post,/game/count/*`],
  r: params => {
    return axios.post(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 重置用户密码
const resetPassword = {
  p: [`get,/game/count/*`],
  r: params => {
    return axios.get(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 删除用户
const deleteUser = {
  p: [`get,/game/count/*`],
  r: params => {
    return axios.get(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}


// 查询角色列表
const getRoleList = {
  p: [`post,/game/count/*`],
  r: params => {
    return axios.post(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 新增角色
const addRole = {
  p: [`post,/game/count/*`],
  r: params => {
    return axios.post(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 删除角色
const deleteRole = {
  p: [`post,/game/count/*`],
  r: params => {
    return axios.post(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}


// 设置角色权限
const grantRoleAccess = {
  p: [`post,/game/count/*`],
  r: params => {
    return axios.post(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}

// 设置用户密码
const setUserPassword = {
  p: [`post,/game/count/*`],
  r: params => {
    return axios.post(`${preUrl}/game/count/${Cookie.get('areaCode')}/`, {
      params
    })
  }
}


export {
  getUserList,
  searchUserList,
  addUser,
  editUser,
  resetPassword,
  deleteUser,
  getRoleList,
  addRole,
  deleteRole,
  grantRoleAccess,
  setUserPassword,
}